package com.xy.controller;

import com.xy.entity.Student;
import com.xy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class StudentController {
    @Autowired
    UserService userService;
    @GetMapping("/getallstudent")
    public List<Student> getallstudent(){
        List<Student> students = userService.findall();
        for (Student student : students) {
            System.out.println(student);
        }
        return students;
    }
}
